﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="True" CodeBehind="ESS_MoneyRequestMulti.aspx.cs" Inherits="KPIS.GERP.ESS.APP.App_UI.Forms.ESS_MoneyRequestMulti" %>

<%@ Register src="../Controls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <title>ขอเบิกเงิน/ยืมเงินทีละหลายรายการ</title>
    
    <link href="../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="../Scripts/Common.js" type="text/jscript"></script>
    <script language="JavaScript" src="../Scripts/DatePicker.js" type="text/jscript"></script>
    
    <style type="text/css">
        .auto-style1
        {
            height: 20px;
        }
    </style>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="aaa">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="aaa" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="true"
        BackgroundPosition="none" CssClass="LoadingPanel">
        <div>
            <table>
                <tr>
                    <td style="color: #666666; font-size: medium; font-weight: bold;" align="right" valign="bottom">
                        กรุณารอสักครู่...
                        <asp:Image id="Image1" runat="server" ImageUrl="../Images/PageViews/loading.gif" />
                    </td>
                </tr>
            </table>
        </div>
    </telerik:RadAjaxLoadingPanel>
    <div id="aaa" runat="server">
        <div class="DivInfo">
            <table>
                <tr>
                    <td width="150px" align="right">
                        หน่วยงานที่สังกัด :
                    </td>
                    <td width="250px">
                        <asp:Label ID="lblMoneyReqSeq" runat="server" Visible="False" />
                        <asp:Label ID="lblRecordStatus" runat="server" Visible="false" />
                        <asp:Label ID="lblWorkingJobSiteSeq" runat="server" Visible="false" />
                        <asp:Label ID="lblWorkAreaSeq" runat="server" Visible="false" />
                        <asp:Label ID="lblWorkingJobSiteName" runat="server" ForeColor="Blue" />
                    </td>
                    <td width="100px" align="right">
                        วันที่ทำรายการ :
                    </td>
                    <td>
                        <asp:Label ID="lblMoneyReqDate" runat="server" ForeColor="Blue" />
                    </td>
                </tr>
            </table>
        </div>
                        
        <div class="DivBody">
            <table>
                <tr>
                    <td width="150px" align="right">
                        ปีงบประมาณ :
                    </td>
                    <td >
                        <telerik:RadNumericTextBox ID="txtBgmYear" runat="server"
                            Width="100px" ShowSpinButtons="True" AutoPostBack="true"
                            NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator=""
                            OnTextChanged="txtBgmYear_TextChanged" />
                    </td>
                </tr>
            </table>
            <table >
                <tr>
                    <td width="150px" align="right">
                        แหล่งเงิน :
                    </td>
                    <td>
                        <telerik:RadComboBox ID="ddlBgmSourceSeq" runat="server"
                            DataTextField="bgm_source_name" DataValueField="bgm_source_seq"
                            AutoPostBack="true" 
                            OnSelectedIndexChanged="ddlBgmSourceSeq_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="150px" align="right">
                        รหัสรายการ :
                    </td>
                    <td>
                        <asp:Label ID="lblRefNo1" runat="server" ForeColor="Blue" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="150px" align="right">
                        อนุมัติดำเนินงาน :
                    </td>
                    <td>
                        <telerik:RadComboBox ID="ddlBgmProjOperSeq" Runat="server" 
                            DataTextField="bgm_proj_oper_name" DataValueField="bgm_proj_oper_seq"
                            Filter="Contains" Width="600px" AutoPostBack="true"
                            OnSelectedIndexChanged="ddlBgmProjOperSeq_SelectedIndexChanged">
                        </telerik:RadComboBox>
                        <span class="span">&nbsp;*</span>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td align="right" width="150px" valign="top" class="valignTop">
                        ชื่อรายการ :
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtMoneyReqName" runat="server"
                            Width="600px" Height="50px" TextMode="MultiLine" />
                        <span class="span">&nbsp;*</span>
                    </td>
                </tr>
            </table>
            <%--<table>
                <tr>
                    <td align="right" width="150px">
                        เบิกให้กับ
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rblPayeeType" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Text="บุคคลภายใน" Value="1" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="บุคคลภายนอก" Value="2"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
            </table>--%>
            <table>
                <tr>
                    <td width="150px" align="right">
                        งบรายจ่าย :
                    </td>
                    <td>
                        <telerik:RadComboBox ID="ddlBgmExpGrpSeq" Runat="server" 
                            DataTextField="bgm_exp_grp_name" DataValueField="bgm_exp_grp_seq"
                            Filter="Contains" Width="200px" AutoPostBack="true"
                            OnSelectedIndexChanged="ddlBgmExpGrpSeq_SelectedIndexChanged" >
                        </telerik:RadComboBox>
                    </td>
                </tr>
            </table>
        </div>
    
                        <%-- Prevent to fix height by session because session is not stable
                             Height='<%# Unit.Pixel(KPIS.GERP.ESS.APP.App_UI.Forms.SsMng.HeightI - 280) %>' --%>
        <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="grdMoneyRequestDtls" runat="server" AutoGenerateColumns="false"
            AllowMultiRowEdit="false" AllowMultiRowSelection="true" AllowFilteringByColumn="true"
            Width="1000px"
            AllowPaging="false" ShowFooter="false"
            GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
            GroupingSettings-GroupContinuedFormatString=""
            GroupingSettings-GroupContinuesFormatString=""
            GroupingSettings-GroupSplitFormat="">
            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client" Width="100%"
                DataKeyNames="m_bgm_projectoperationexpense.bgm_proj_oper_exp_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                <Columns>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.bgm_proj_oper_exp_seq"
                        UniqueName="m_bgm_projectoperationexpense.bgm_proj_oper_exp_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.bgm_proj_oper_seq"
                        UniqueName="m_bgm_projectoperationexpense.bgm_proj_oper_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.m_bgm_mas_expense_upper.bgm_exp_name"
                        UniqueName="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.m_bgm_mas_expense_upper.bgm_exp_name"
                        HeaderText="รายการค่าใช้จ่าย" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.m_bgm_mas_expense_upper.m_bgm_mas_expense_upper.bgm_exp_name"
                        UniqueName="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.m_bgm_mas_expense_upper.m_bgm_mas_expense_upper.bgm_exp_name"
                        HeaderText="หมวดค่าใช้จ่าย" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.m_bgm_projectexpense.bgm_exp_seq"
                        UniqueName="m_bgm_projectoperationexpense.m_bgm_projectexpense.bgm_exp_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="money_req_dtls_seq"
                        UniqueName="money_req_dtls_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="money_req_seq"
                        UniqueName="money_req_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="percent_vat"
                        UniqueName="percent_vat" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="percent_tax"
                        UniqueName="percent_tax" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="amount_vat"
                        UniqueName="amount_vat" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="amount_tax"
                        UniqueName="amount_tax" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.exp_rate_count"
                        UniqueName="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.exp_rate_count" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.class_count"
                        UniqueName="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.class_count" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="exp_rate_count"
                        UniqueName="exp_rate_count" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.icm_res_item_seq"
                        UniqueName="m_bgm_projectoperationexpense.icm_res_item_seq" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="unit_price"
                        UniqueName="unit_price" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="unit_qty"
                        UniqueName="unit_qty" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.unit_price"
                        UniqueName="m_bgm_projectoperationexpense.unit_price" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.unit_qty"
                        UniqueName="m_bgm_projectoperationexpense.unit_qty" Visible="False">
                    </telerik:GridBoundColumn>

                    <telerik:GridClientSelectColumn  UniqueName="GridCheckBoxColumn">
                        <HeaderStyle Width="30px" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridClientSelectColumn>  
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.bgm_exp_name" HeaderText="ค่าใช้จ่าย"
                        UniqueName="m_bgm_projectoperationexpense.m_bgm_projectexpense.m_bgm_mas_expense.bgm_exp_name"
                        FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" ItemStyle-HorizontalAlign="Left">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="remarks" HeaderText="หมายเหตุ"
                        UniqueName="remarks"
                        FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False" ItemStyle-HorizontalAlign="Left">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="m_bgm_projectoperationexpense.remain_amount" HeaderText="คงเหลือ(บาท)"
                        UniqueName="m_bgm_projectoperationexpense.remain_amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="Contains" ShowFilterIcon="False"
                        DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Width="110px" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                GroupContinuedFormatString="" GroupContinuesFormatString="" 
                GroupSplitFormat="" />
            <ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
            </ClientSettings>
        </telerik:RadGrid>
    
        <div id="divConfirm" runat="server" class="DivControl">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="cmdConfirm" runat="server" CssClass="LinkButtonWhite" OnClick="cmdConfirm_Click" Text="ยืนยันข้อมูล" OnClientClick="javascript: return confirm('ยืนยันข้อมูลหรือไม่?');"></asp:LinkButton>
        </div>
        <asp:HiddenField ID="hRecordCount" runat="server" />
        <div id="divAddRecord" runat="server" class="DivControl">
            <asp:LinkButton ID="cmdAddRecord" runat="server" CssClass="LinkButtonWhite" OnClick="cmdAddRecord_Click" Visible="false">
                <img alt="" id="imgAddNew" runat="server" height="14" src="~/App_UI/Images/Buttons/AddRecord.gif" /> เพิ่มรายการใหม่
            </asp:LinkButton>
        </div>
        <br />
        <asp:Panel ID="panelExpense" runat="server" >
            
        </asp:Panel>
        <br />
        <div id="divSave" runat="server" class="DivControl">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="cmdSave" runat="server" CssClass="LinkButtonWhite" OnClick="cmdSave_Click" Visible="false" OnClientClick="javascript: return confirm('ต้องการบันทึกข้อมูลหรือไม่?');">
                <img alt="" id="img1" runat="server" height="14" src="~/App_UI/Images/Buttons/saveDisk.gif" /> บันทึก
            </asp:LinkButton>
        </div>
    </div>
</asp:Content>
